import { Window_Command } from "@/windows/Window_Command.js";
import { TextManager } from "@/managers/TextManager.js";
import { SceneManager } from "@/managers/SceneManager.js";
import { Scene_Map } from "@/scenes/Scene_Map";
import { Scene_Options } from "@/scenes/Scene_Options";
import { DataManager } from "@/managers/DataManager.js";

export class Window_TitleCommand extends Window_Command {
    constructor(width,maxHeight) {
        super(width, maxHeight);
    }
    
    makeCommands() {
        this.addCommand(TextManager.newGame,this.OnNewGame.bind(this));
        this.addCommand(TextManager.continue_, this.OnContinue.bind(this), !this.isContinueEnabled());
        this.addCommand(TextManager.options,  this.OnOptions.bind(this));
    }

    isContinueEnabled() {
        return false;
    }

    OnNewGame(){
        DataManager.setupNewGame();
        this.close();
        SceneManager.goto(Scene_Map);
    }

    OnContinue(){
        this.close();
        SceneManager.push(Scene_Load);
    }

    OnOptions(){
        this.close();
        SceneManager.push(Scene_Options);
    }
    
    
}